#include "gui/VisualComponents/ArrowHead.h"
#include <gtkmm.h>
#include <cmath>

ArrowHead::ArrowHead() :
		arrow_lenght_(15), arrow_degrees_(0.5) {
}

void ArrowHead::calcVertexes(double start_x, double start_y, double end_x,
		double end_y, double& x1, double& y1, double& x2, double& y2) {
	double angle = atan2(end_y - start_y, end_x - start_x) + M_PI;
	x1 = end_x + arrow_lenght_ * cos(angle - arrow_degrees_);
	y1 = end_y + arrow_lenght_ * sin(angle - arrow_degrees_);
	x2 = end_x + arrow_lenght_ * cos(angle + arrow_degrees_);
	y2 = end_y + arrow_lenght_ * sin(angle + arrow_degrees_);
}
